


var snap = require('../index.js');
//var app = require('SubscriberApp1');

var CONFIG_FILENAME = './conf/appconfig.json';
try {
	snap.init(CONFIG_FILENAME);
	//snap.loadSubscriber(app);
} catch(e) {
	console.log('Error: '+e.stack);
}

process.on('uncaughtException', function(err) {
	console.log(err.stack);
});

/*this fucntion closes the traces files and records process's uptime when the process exits */
process.on('exit', function() {
	console.log ('Exiting ...');
	console.log('process uptime : '+process.uptime());
	snap.exit();
});